package com.jt.util;

import com.jt.pojo.User;

public class UserThreadLocal {
    private static ThreadLocal<User> userThreadLocal=new ThreadLocal<>();
    //存储数据
    public static void set(User user){
        userThreadLocal.set(user);
    }
    //取出数据
    public static User get(){
        return userThreadLocal.get();
    }
    //删除数据，防止内存泄漏
    public static void remove(){
        userThreadLocal.remove();
    }
}
